﻿#region

using System;
using System.Collections.Generic;
using MediaSage.Lib.Plugin;

#endregion

namespace MediaSage.Lib.Database
{
    public class PluginEntity : DatabaseObject
    {
        #region Constructors

        public PluginEntity()
        {
            ConfigurationItems = new List<PluginConfigurationItemEntity>();
            ID = Guid.NewGuid();
        }

        #endregion Constructors

        #region Properties

        public virtual PluginIDObjectType IDObjectType { get; set; }

        public virtual int BuildNumber { get; set; }

        public virtual IList<PluginConfigurationItemEntity> ConfigurationItems { get; set; }

        public virtual IList<MediaFileTypesEntity> ExtensionsHandled { get; set; }

        public virtual Guid ID { get; protected set; }

        /// <summary>
        ///     Defines if the provider is used currently
        /// </summary>
        public virtual bool IsActive { get; set; }

        public virtual string Location { get; set; }

        public virtual int MajorVersion { get; set; }

        public virtual int MinorVersion { get; set; }

        public virtual string Name { get; set; }

        public virtual PluginType PluginType { get; set; }

        /// <summary>
        ///     Priority defines what goes first, which goes last.  The last one is the highest priority
        ///     as it will overwrite what the previous ones have written
        /// </summary>
        public virtual int Priority { get; set; }

        public virtual bool UpdateAutomatically { get; set; }

        public virtual string UpdateURL { get; set; }

        #endregion Properties

        public override void Save()
        {
            base.Save();
        }

        public override void SaveOrUpdate()
        {
            base.SaveOrUpdate();
        }
    }
}